<?php session_start();
	include('../controller/functions.php');
	User::connection();


	$userArr	= array('admin','student','teacher');
	if(!in_array($_SESSION['user'],$userArr)) {
	User::validSession();

}
if ($_GET['q'] == 'logout') 
{
	User::user_logout();
	print '		
			<script type="text/javascript">		
			window.location = "../login_r.php";
			</script>
			';

}

$email = $_SESSION['em'];


function change_pass()
{
	$npass = $_POST['password_confirm'];
	$e = $_SESSION['email'];
	$query = mysql_query("UPDATE `tbluser` SET password='$npass' WHERE email='$email'");
	if($query)
	{
		echo "You have successfuly changed your password!";
	}
}
?>